package com.lin.manager.task.service;

import com.lin.manager.common.req.QueryPage;
import com.lin.manager.common.utils.PageUtil;
import com.lin.manager.task.entity.TaskBusEntity;
import com.lin.manager.task.entity.TaskPlainEntity;
import com.lin.manager.task.model.TaskPlainVo;

import java.util.List;

/**
 * @作者: 林江
 * @创建时间: 2024/3/25
 * @功能:
 */
public interface TaskService {

    void saveJob(TaskBusEntity taskBus) throws Exception;

    void updateJob(TaskBusEntity taskBus) throws Exception;

    TaskBusEntity getJob(String key) throws Exception;

    void deleteJobById(String key) throws Exception;

    void deleteJob(String key, String group) throws Exception;

    void startJob(String key, String group) throws Exception;

    void savePlan(TaskPlainVo taskPlain) throws Exception;

    void updatePlan(TaskPlainVo taskPlain) throws Exception;

    TaskPlainEntity getPlan(String id) throws Exception;

    void pausePlan(String key, String group) throws Exception;

    void startPlan(String key, String group) throws Exception;

    void deletePlanById(String key) throws Exception;
    void deletePlan(String key, String group) throws Exception;

    /**
     * 启动所有的触发程序
     *
     * @throws Exception
     */
    void start() throws Exception;

    PageUtil listByPage(QueryPage page);

    List<TaskBusEntity> list();

    PageUtil listPlanPage(QueryPage page);

    List<TaskPlainEntity> listPlan();
}
